module AutoComplete
  module ViewHelper
    def auto_complete(id, array)
      javascript_tag("$().ready(function(){ $('#" + id + "').autocomplete(" + array + "); });")
    end
  end
end